<?php
$nodeUrl="[php_property:node_url]";

$level="[php_property:level]";

if (($level == "") or ($level == "1"))
    {
    if ($nodeUrl == "")
        {
        $nodeUrl="/web";
        }

    $parentId=db::getValue("SELECT id FROM content WHERE _url='$nodeUrl'");
    }
else
    {

    $parentId=-1;

    if (isset(config::$parentList[$level]))
        {
        $parentId=config::$parentList[$level];
        }
    }


// Sortierreihenfolge
$orderBy="[php_property:orderby]";

if ($orderBy == "")
    {
    $orderBy="item_order";
    }


$sqlMenu="SELECT content.id content_id,content.title,content._url FROM content,usergroup WHERE _usergroup=usergroup.id AND menu_active = 1 AND usergroup_number<='" . config::$userData["usergroup_number"] . "'
            AND item_parent_id = '$parentId' ORDER BY $orderBy";

foreach (db::getQuery($sqlMenu) as $dataquery_menu)
    {
  
?>